package data;

import java.awt.Graphics2D;

import main.Core;

/**
 * 
 * @author Ygor
 *
 */
public abstract class Sprite extends SceneObject {
	
	private float x;
	private float y;
	private boolean visible;
	
	public Sprite(int X, int Y, boolean visible, Core c) {
		super(c);
		this.setX(X);
		this.setY(Y);
		this.setVisible(visible);
	}

	@Override
	public abstract void Update(float elapsedTime);
	@Override
	public abstract void Draw(Graphics2D g);
	
	public abstract int getWidth();
	
	public abstract int getHeight();

	public SceneObject remover(String key){
		this.setVisible(false);
		return super.remover(key);
	}

	/**
	 * @return the visible
	 */
	public boolean isVisible() {
		return visible;
	}

	/**
	 * @param visible the visible to set
	 */
	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	/**
	 * @return the y
	 */
	public float getY() {
		return y;
	}

	/**
	 * @param y the y to set
	 */
	public void setY(float y) {
		this.y = y;
	}

	/**
	 * @return the x
	 */
	public float getX() {
		return x;
	}

	/**
	 * @param x the x to set
	 */
	public void setX(float x) {
		this.x = x;
	}
	
	public Float2 getLocation()
	{
		return new Float2(x, y);
	}
	public void setLocation(Float2 loc)
	{
		this.setX(loc.getF1());
		this.setY(loc.getF2());
	}
}
